package com.tem.system.utils;

public class MyStringUtil {
    /*private static final MyStringUtil instance = new MyStringUtil();
    public static MyStringUtil getInstance(){
        try {
            Thread.sleep(1000*2);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("new instance");
        return instance;
    }*/

    private static MyStringUtil myStringUtil = null;
    private static String syKey = "MyStringUtil";
    public static MyStringUtil getInstance(){
        //synchronized (syKey) {
            if (myStringUtil == null) {
                try {
                    Thread.sleep(1000 * 2);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("new instance");
                myStringUtil = new MyStringUtil();
            }
        //}
        return myStringUtil;
    }
}